package jihe;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class shiyanb {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set xy = new TreeSet<String>();
		while (sc.hasNext()) {
			String str = sc.next();
			if (str.equals("!!!!!"))
				break;
			xy.add(str);
		}
		System.out.println(xy.size());
		if (xy.size() < 10) {
			for (int i = 0; i < xy.size(); i++)
				System.out.println(xy.toArray()[i]);
		} else {
			for (int i = 0; i < 10; i++)
				System.out.println(xy.toArray()[i]);
		}
	}
}
